(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/transaction/sell/sell" ], {
    "43dd": function(t, e, n) {
        n.r(e);
        var a, o = n("97eb"), s = n("8b4b");
        for (a in s) "default" !== a && function(t) {
            n.d(e, t, function() {
                return s[t];
            });
        }(a);
        n("4620");
        var i = n("f0c5"), o = Object(i.a)(s.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        e.default = o.exports;
    },
    4620: function(t, e, n) {
        var a = n("5e20");
        n.n(a).a;
    },
    "5d6c": function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("8163"), e(n("66fd")), t(e(n("43dd")).default);
        }).call(this, n("543d").createPage);
    },
    "5e20": function(t, e, n) {},
    "8b4b": function(t, e, n) {
        n.r(e);
        var a, o = n("bb5d"), s = n.n(o);
        for (a in o) "default" !== a && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(a);
        e.default = s.a;
    },
    "97eb": function(t, e, n) {
        function a() {
            var t = this, e = (t.$createElement, t._self._c, Number(t.charge).toFixed(1));
            t.$mp.data = Object.assign({}, {
                $root: {
                    g0: e
                }
            });
        }
        var o = {
            sunuiUpimg1: function() {
                return n.e("components/sunui-upimg1/sunui-upimg1").then(n.bind(null, "b0f1"));
            },
            sunuiCell: function() {
                return n.e("components/sunui-cell/sunui-cell").then(n.bind(null, "3c51"));
            }
        }, s = [];
        n.d(e, "b", function() {
            return a;
        }), n.d(e, "c", function() {
            return s;
        }), n.d(e, "a", function() {
            return o;
        });
    },
    bb5d: function(t, i, r) {
        (function(a) {
            Object.defineProperty(i, "__esModule", {
                value: !0
            }), i.default = void 0;
            var s = t(r("4795")), o = t(r("5438"));
            function t(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            function c(t, e, n, a, o, s, i) {
                try {
                    var r = t[s](i), c = r.value;
                } catch (t) {
                    return n(t), 0;
                }
                r.done ? e(c) : Promise.resolve(c).then(a, o);
            }
            function e(r) {
                return function() {
                    var t = this, i = arguments;
                    return new Promise(function(e, n) {
                        var a = r.apply(t, i);
                        function o(t) {
                            c(a, e, n, o, s, "next", t);
                        }
                        function s(t) {
                            c(a, e, n, o, s, "throw", t);
                        }
                        o(void 0);
                    });
                };
            }
            var n = {
                data: function() {
                    return {
                        upPicUrl: "https://" + this.$domain + "/app/index.php?i=" + this.$uniacid + "&c=entry&a=wxapp&do=upload&m=wjyk_recycle",
                        categoryList: [],
                        categoryIndex: 0,
                        labelList: [],
                        labelIndex: 0,
                        systemObj: {},
                        charge: 0,
                        obj: {
                            id: "",
                            uid: "",
                            category_id: "",
                            category_Name: "",
                            label: "",
                            name: "",
                            pic_url: "",
                            price: "",
                            is_bargain: 2,
                            stock: "",
                            desc: "",
                            province: "",
                            city: "",
                            county: "",
                            address: "",
                            consignee: "",
                            consignee_phone: "",
                            wxno: ""
                        }
                    };
                },
                onShow: function() {
                    o.default.releaseKey("sellSub"), this.getAddress(), this.getCateList(), this.getLabelList(), 
                    this.getSystem();
                },
                methods: {
                    getAddress: function() {
                        var n = this;
                        return e(s.default.mark(function t() {
                            var e;
                            return s.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$sun.latlng();

                                  case 2:
                                    e = t.sent, n.getCity(e.lng, e.lat);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getCity: function(n, a) {
                        var o = this;
                        return e(s.default.mark(function t() {
                            var e;
                            return s.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, o.$http({
                                        url: o.$api.getCity,
                                        data: {
                                            lng: n,
                                            lat: a
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (o.obj.province = e.data.address_component.province, 
                                    o.obj.city = e.data.address_component.city, o.obj.county = e.data.address_component.district, 
                                    o.obj.address = e.data.address);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getSystem: function() {
                        var n = this;
                        return e(s.default.mark(function t() {
                            var e;
                            return s.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.systemObj = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getCateList: function() {
                        var n = this;
                        return e(s.default.mark(function t() {
                            var e;
                            return s.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.tCateList
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.categoryList = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getLabelList: function() {
                        var n = this;
                        return e(s.default.mark(function t() {
                            var e;
                            return s.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.transactions
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.labelList = e.data.set.label, n.charge = e.data.set.charge);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    imgsChange1: function() {
                        this.$refs.selectimgandupload1.upload();
                    },
                    imgLoaded1: function(t) {
                        try {
                            this.obj.pic_url = "";
                            for (var e = 0; e < t.length; e++) {
                                if (e == t.length - 1) return void (this.obj.pic_url += t[e].url);
                                this.obj.pic_url += t[e].url + ",";
                            }
                        } catch (t) {
                            this.obj.pic_url = "";
                        }
                    },
                    pickChange: function(t) {
                        console.log("----", this.categoryList[t.target.value].name), this.categoryIndex = t.target.value, 
                        this.obj.category_id = this.categoryList[t.target.value].id, this.obj.category_name = this.categoryList[t.target.value].name;
                    },
                    pickChange2: function(t) {
                        this.labelIndex = t.target.value, this.obj.label = this.labelList[t.target.value].name;
                    },
                    switchChange4: function(t) {
                        console.log("switch4 发生 change 事件，携带值为", t.target.value), t.target.value ? this.obj.is_bargain = 1 : this.obj.is_bargain = 2;
                    },
                    submit: function() {
                        var t, n = this;
                        this.obj.province ? this.obj.desc ? this.obj.pic_url ? this.obj.name ? this.obj.category_id ? this.obj.label ? this.obj.stock ? this.obj.price ? this.obj.consignee ? 11 == this.obj.consignee_phone.length ? o.default.uniDoFunc({
                            key: "sellSub",
                            success: (t = e(s.default.mark(function t() {
                                var e;
                                return s.default.wrap(function(t) {
                                    for (;;) switch (t.prev = t.next) {
                                      case 0:
                                        return t.next = 2, n.$http({
                                            url: n.$api.editGoods,
                                            data: {
                                                uid: a.getStorageSync("uid"),
                                                category_id: n.obj.category_id,
                                                label: n.obj.label,
                                                name: n.obj.name,
                                                pic_url: n.obj.pic_url,
                                                price: n.obj.price,
                                                is_bargain: n.obj.is_bargain,
                                                stock: n.obj.stock,
                                                desc: n.obj.desc,
                                                province: n.obj.province,
                                                city: n.obj.city,
                                                county: n.obj.county,
                                                address: n.obj.address,
                                                consignee: n.obj.consignee,
                                                consignee_phone: n.obj.consignee_phone,
                                                wxno: n.obj.wxno
                                            }
                                        });

                                      case 2:
                                        0 == (e = t.sent).errno ? (n.obj.category_id = "", n.obj.category_Name = "", n.obj.label = "", 
                                        n.obj.name = "", n.obj.pic_url = "", n.obj.price = "", n.obj.is_bargain = 2, n.obj.stock = "", 
                                        n.obj.desc = "", n.obj.consignee = "", n.obj.consignee_phone = "", n.obj.wxno = "", 
                                        setTimeout(function() {
                                            n.$refs.selectimgandupload1.setItems([]);
                                        }, 500), a.showToast({
                                            title: e.message,
                                            duration: 1500
                                        }), setTimeout(function() {
                                            a.navigateTo({
                                                url: "/wjyk_recycle/pages/transaction/my/grounding/grounding"
                                            });
                                        }, 1500)) : (n.$sun.toast(e.message), o.default.releaseKey("sellSub")), console.log("防抖... 在事件触发前连续点击事件会重新计时");

                                      case 5:
                                      case "end":
                                        return t.stop();
                                    }
                                }, t);
                            })), function() {
                                return t.apply(this, arguments);
                            })
                        }) : this.$sun.toast("请输入正确的手机号码") : this.$sun.toast("请输入姓名") : this.$sun.toast("请输入商品价值") : this.$sun.toast("请输入商品库存") : this.$sun.toast("请选择商品标签") : this.$sun.toast("请选择商品分类") : this.$sun.toast("请输入商品名称") : this.$sun.toast("请上传商品图片") : this.$sun.toast("请输入商品介绍") : this.$sun.toast("当前定位异常,请检查是否开启GPS");
                    }
                }
            };
            i.default = n;
        }).call(this, r("543d").default);
    }
}, [ [ "5d6c", "common/runtime", "common/vendor" ] ] ]);